Note: Unlike in Visual Basic, in SCR if you omit an optional argument, you must omit all the following arguments. For example, if you do not specify a delimiter, you cannot specify count nor compare.
Split takes a String that contains a number of substrings, breaks it up into a specified number of substrings and returns an array containing the substrings.
The following examples are applicable to both Basic and Crystal syntax:
Split ("Chocolate Strawberry Pineapple")
Returns an array that contains 3 elements, "Chocolate", "Strawberry" and "Pineapple".
Split ("Chocolate//Strawberry//Pineapple", "//")
Returns an array that contains 3 elements, "Chocolate", "Strawberry" and "Pineapple".
Split ("Chocolate//Strawberry//Pineapple", "//", 2)
Returns an array that contains 2 elements, "Chocolate" and "Strawberry//Pineapple". The last element in the array is a concatenation of the 2nd substring and the remaining substring.
Split ("Chocolate and Strawberry and Pineapple", " And ",
Returns an array that contains 1 element, "Chocolate and Strawberry and Pineapple". The delimiter " And " cannot be matched.
Split ("Chocolate and Strawberry and Pineapple", " And ",
Returns an array that contains 3 elements, "Chocolate", "Strawberry" and "Pineapple". The delimiter " And " is matched with " and " regardless of the case.
Seagate Software IMG Holdings, Inc. http://www.seagatesoftware.com Support services: http://support.seagatesoftware.com |